package com.design.principle.openclose.impl;

/**
 * @auther LiZiBa
 * @date 2020/8/2 0:58
 * @description:
 **/
public class JavaDiscountCourse extends JavaCourse{

    public JavaDiscountCourse(Integer id, String name, Double price) {
        super(id, name, price);
    }

    /**
     * 获取Java打折后的价格，符合开闭原则，注意里式替换原则
     * @return
     */
    public Double getJavaDiscountPrice() {

        return this.getPrice() * 0.8;
    }
}
